The present invention relates to a structure of memory-stored compressed waveform data for use in tone generation apparatus etc., a tone generation apparatus for generating tones by reading out the compressed waveform data, and a waveform storage processing apparatus for writing compressed waveform data into a memory. The present invention also relates to a waveform data compression method, tone signal generation method and tone signal processing apparatus and program which are suitable for use in tone generation apparatus that store waveform data after compressing the waveform data on a frame-by-frame basis and reproduce the stored waveform data on the basis of performance information.
Among the conventionally-known tone signal generation methods for use in electronic musical instruments is the PCM method which prestores, in a memory, digital waveform sample data obtained by successively sampling and digitizing instantaneous values of tone waveforms of a natural musical instrument and then, at the time of tone reproduction, generates tone signals by reading out the prestored waveform sample data. The PCM method can advantageously generate tones very close to those of a natural musical instrument, but disadvantageous in that the memory for storing the waveform sample data must have an enormous storage capacity. To avoid such a problem presented by the PCM method, there have been proposed a tone signal generation apparatus which compresses samples of waveform data, stores the compressed waveform data in a memory and then, at the time of tone reproduction, forms tone signals by decompressing the stored compressed waveform data (e.g., Japanese Patent No. 2605434).
In the proposed tone signal generation apparatus, the storage capacity of the memory can be used efficiently because the memory stores the compressed waveform sample data. Specifically, the waveform sample data to be stored in the memory are compressed into a variable length, divided or segmented into frames each composed of a fixed number (e.g., 16 samples) of the compressed waveform data, and then stored in the memory on a frame-by-frame basis. Therefore, the total number of bits in each of the frames is variable depending on the number of bits per sample of the compressed waveform data. In this case, where each of the frames has a variable length, respective start positions, in the memory, of the frames differ considerably. Thus, there arises a need for a circuit to calculate the respective leading addresses of the frames, which would greatly complicate the construction of circuitry for decompressing the compressed waveform data.
According to the frame-by-frame compression scheme, the waveform data are segmented into predetermined frame sections and compressed on the frame-by-frame basis, in order to reduce the storage capacity for storing the waveform data in a waveform-memory tone generator apparatus. Various waveform data coding schemes or techniques have been known, of which the “linear prediction technique” is used extensively today because it can achieve a high compression efficiency and reduce processing loads at the time of tone reproduction. Note that the linear prediction technique is a technique for determining a predicted value of each sample of interest on the basis of several sample values preceding the sample of interest and predetermined generating polynomial expression and then recording, as difference data, a difference between the predicted value and a corresponding actual value.
In reproduction of waveform data, it is conventional to reproduce a leading portion, i.e. attach portion, of the waveform data only once and then repeatedly reproduce the remaining portion, i.e. loop portion of the waveform data (loop reproduction). Therefore, it is necessary to identify in advance loop start and end points of a loop portion in a succession of frames which are the first and last sampling points of the loop portion. In the past, the frame-by-frame compression scheme would present the problem that the loop start and end points are restricted to boundary positions of the frames because of the necessity to reproduce the waveform data on the frame-by-frame basis. Namely, because the loop start point and loop end point can not be set at appropriate sampling points, there would arise the problem that undesired noise is produced due to discontinuity in signal level and phase when the waveform data reproduction shifts from the loop end point back to the loop start point.
Japanese Patent No. 2674155 discloses a technique designed to prevent such undesired noise, which, once given points of waveform data are designated as loop start and loop end points, performs time-axial adjustment (compression, expansion or shift in the time-axial direction) on the entire waveform data so as to allow the loop start and loop end points to coincide with frame boundaries.
However, with the technique disclosed in the No. 2674155 patent, there would be encountered the problems that the quality of the waveform data deteriorates during the time-axial compression or expansion and the necessary amount of processing becomes enormous because the processing is performed on all of the waveform data. Further, in the disclosed conventional technique, where header information for decompression compression codes is stored at the beginning of each frame, it is necessary to read out all of the header information of the frames before initiation of the decompression process. Therefore, during the course of the decompression process on a given frame, a sufficient time has to be secured for reading out in advance the header information of the next frame. Because the disclosed conventional technique is based on decompression of all of the compression codes per frame, it may readily secure such a time. However, if the data structure disclosed in the patent is employed in an “apparatus capable of setting a loop start point or loop end point partway through a frame (i.e., at an enroute point of the frame)”, in other words “apparatus where a reproducing time of a proportion of the frames can be extremely short”, there can not be secured a sufficient time for reading out in advance the header information.